package org.walkerljl.commons.unit.service.impl;

import org.walkerljl.commons.unit.dao.UserDao;
import org.walkerljl.commons.unit.domain.User;
import org.walkerljl.commons.unit.service.UserService;

/**
 * @author: lijunlin
 */
public class UserServiceImpl implements UserService {

    private UserDao userDao;

    @Override
    public boolean register(User user) {
//        System.out.println("user:" + u.toString());
//
//        System.out.println("user:" + user.toString());
//        System.out.println("user gender:" + user.getGender());
//        System.out.println("user static:" + user.doStatic());

        return isExists(user.getUserId());
    }

    private boolean isExists(String userId) {
        User user = userDao.selectByUserId(userId);
        return user != null;
    }
}
